Skip to content

feat(tempo): add split payments for charge#231

Open
brendanjryan wants to merge 10 commits intomainfrom
brendanjryan/pr203-split-payments
Open

feat(tempo): add split payments for charge#231
brendanjryan wants to merge 10 commits intomainfrom
brendanjryan/pr203-split-payments

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

@brendanjryan brendanjryan commented Mar 24, 2026

Summary

  • add splits support to Tempo charge request validation and wire serialization
  • build ordered primary-plus-split transfer sequences on the client and verify them for both transaction and hash credentials on the server
  • extend fee-payer validation for split transfers and add split-focused tests plus a changeset

Spec: tempoxyz/mpp-specs#203

@brendanjryan brendanjryan force-pushed the brendanjryan/pr203-split-payments branch 8 times, most recently from 7e70a6c to d56bda9 Compare March 24, 2026 23:58
@brendanjryan brendanjryan force-pushed the brendanjryan/pr203-split-payments branch from d56bda9 to b944184 Compare March 25, 2026 00:05
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/mppx@231

commit: 6fe20f0

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/mppx@231

commit: b944184

@brendanjryan brendanjryan force-pushed the brendanjryan/pr203-split-payments branch 3 times, most recently from 499b36f to cce70a1 Compare March 26, 2026 21:27
@legion2002
Copy link
Copy Markdown

👁️ Cyclops Security Review

49263cb

🧭 Auditing · mode=normal · workers 0/3 done (3 left) · verify pending 0

Worker Engine Progress Status
pr-231-w1 gemini-3.1-pro-preview · · · Running
pr-231-w2 amp/deep · · · Running
pr-231-w3 gpt-5.4 · · · Running
⚙️ Controls
  • 🚀 Keep only 1 remaining iteration per worker after the current work finishes.
  • 👀 Keep only 2 remaining iterations per worker after the current work finishes.
  • ❤️ Let only worker 1 continue; other workers skip queued iterations.
  • 😄 Let only worker 2 continue; other workers skip queued iterations.
  • 🎉 End faster by skipping queued iterations and moving toward consolidation.
  • 😕 Stop active workers/verifiers now and start consolidation immediately.

@tempoxyz-bot
Copy link
Copy Markdown

tempoxyz-bot commented Mar 27, 2026

👁️ Cyclops Security Review

49263cb

🧭 Auditing · mode=normal · workers 0/3 done (3 left) · verify pending 0

Worker Engine Progress Status
pr-231-w1 gemini-3.1-pro-preview 🔍 thread-1 · · Running
pr-231-w2 amp/deep 🔍 thread-1 · · Running
pr-231-w3 gpt-5.4 🔍 thread-1 · · Running
⚙️ Controls
  • 🚀 Keep only 1 remaining iteration per worker after the current work finishes.
  • 👀 Keep only 2 remaining iterations per worker after the current work finishes.
  • ❤️ Let only worker 1 continue; other workers skip queued iterations.
  • 😄 Let only worker 2 continue; other workers skip queued iterations.
  • 🎉 End faster by skipping queued iterations and moving toward consolidation.
  • 😕 Stop active workers/verifiers now and start consolidation immediately.

📜 3 events

🔍 pr-231-w1 iter 1/3 [audit-ripple.md]
🔍 pr-231-w2 iter 1/3 [audit-focused.md]
🔍 pr-231-w3 iter 1/3 [audit-deep-focus.md]

Comment on lines +1 to +3
---
'mppx': minor
---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless this is a breaking change, would use patch since we are pre-v1

Suggested change
---
'mppx': minor
---
---
'mppx': patch
---

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

'mppx': minor
---

Add split-payment support to Tempo charge requests, including client transaction construction and stricter server verification for split transfers.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add split-payment support to Tempo charge requests, including client transaction construction and stricter server verification for split transfers.
Added split-payment support to Tempo charge requests, including client transaction construction and stricter server verification for split transfers.

* Allowlist of expected split recipient addresses. When set, the client
* rejects any challenge whose split recipients are not in this list.
*/
expectedRecipients?: readonly string[] | undefined
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address instead of string?

export type Split = {
amount: string
memo?: string | undefined
recipient: string
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address?

export type Transfer = {
amount: string
memo?: string | undefined
recipient: string
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address?

export function getTransfers(request: {
amount: string
methodDetails?: { memo?: string | undefined; splits?: readonly Split[] | undefined }
recipient: string
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address?

- order-insensitive matching for both calldata and logs
- hash path uses log-only verification (spec conformance)
- bind validBefore to min(now+25s, challenge.expires)
- add expectedRecipients allowlist for client-side split validation
- allow transferWithMemo on memo-less split entries
- enforce exact call count only for fee-payer transactions
- sort by specificity (memo-required first) to prevent greedy matching
- try/catch in decodeTransferCall for malformed calldata resilience
- remove dead assertTransferLog and unused imports
Prevents cross-route credential replay where a credential issued for a
no-splits (or no-memo) route is accepted on a route that requires splits
or a specific memo. The methodDetails fields memo and splits now participate
in the scope comparison alongside amount, currency, and recipient.
@brendanjryan brendanjryan force-pushed the brendanjryan/pr203-split-payments branch from a4f66d6 to a1ec1a9 Compare March 27, 2026 22:30
@brendanjryan brendanjryan force-pushed the brendanjryan/pr203-split-payments branch from a1ec1a9 to 6fe20f0 Compare March 27, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants